<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
      xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../../../assert/css/font.css" th:href="@{/assert/css/font.css}"/>
    <link rel="stylesheet" href="../../../assert/css/bootstrap.min.css" th:href="@{/assert/css/bootstrap.min.css}"/>
    <link rel="stylesheet" href="../../../assert/css/plugin/chosen/chosen.css"
          th:href="@{/assert/css/plugin/chosen/chosen.css}"/>
    <link rel="stylesheet" href="../../../assert/css/bootstrap-table.css" th:href="@{/assert/css/bootstrap-table.css}"/>
    <link href="../../../assert/css/animate.min.css" rel="stylesheet" th:href="@{/assert/css/animate.min.css}">
    <link rel="stylesheet" href="../../../assert/css/bootstrap-select.min.css"
          th:href="@{/assert/css/bootstrap-select.min.css}"/>
    <link href="../../../assert/css/plugin/toastr/toastr.min.css" rel="stylesheet"
          th:href="@{/assert/css/plugin/toastr/toastr.min.css}">
    <link href="../../../assert/css/plugin/jsTree/style.min.css" rel="stylesheet"
          th:href="@{/assert/css/plugin/jsTree/style.min.css}">
    <link href="../../../assert/css/loaders.css" rel="stylesheet"
          th:href="@{/assert/css/loaders.css}">
    <link rel="stylesheet" href="../../../assert/css/jquery-ui.css" th:href="@{/assert/css/jquery-ui.css}"/>
    <link rel="stylesheet" href="../../../assert/css/index.css"
          th:href="@{/assert/css/index.css(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"/>
</head>
<body>
<div class="wrapper wrapper-content">
    <div class="ibox">
        <div class="tools_bar">
            <div class="pull-left">
                <a href="#" class="btn btn-default active" id="refresh"><i class="fa fa-refresh"></i> 刷新</a>
            </div>
        </div>
        <div class="tabTitle" style="height: 30px;line-height: 30px;">
            <span class="on">规则命中详情</span>
            <span>语音列表</span>
        </div>
        <div class="ibox-content tab tab0" id="ruleBox" style="padding-top:10px;">
            <table id="ruleTable"></table>
        </div>
        <div class="ibox-content tab tab1" id="audioBox" style="display: none">
            <div class="search on">
                <div class="search_group">
                    <label class="control-label">质检规则：</label>
                    <div class="control-inline">
                        <select type="text" id="rule" value="" class="form-control search_input"></select>
                    </div>
                </div>
                <div class="search_group">
                    <label class="control-label">是否命中：</label>
                    <div class="control-inline">
                        <select type="text" id="isHit" value="" class="form-control search_input"></select>
                    </div>
                </div>
                <div class="search_group">
                    <label class="control-label">录音流水号：</label>
                    <div class="control-inline">
                        <input type="text" id="serialNumber" class="form-control search_input" autocomplete="off">
                    </div>
                </div>
                <div class="search_group">
                    <label class="control-label">满意度：</label>
                    <div class="control-inline">
                        <select type="text" id="agree" value="" class="form-control search_input selectpicker" title="全部" multiple></select>
                    </div>
                </div>
                <div class="search_group">
                    <button id="search" class="btn  btn-primary">查询</button>
                    <button id="reset" class="btn  btn-default">重置</button>
                    <button id="export" class="btn  btn-default">导出</button>
                </div>
            </div>
            <table id="myTable"></table>
        </div>
    </div>
</div>
<form action="" id="exportForm" class="hidden" method="post">
    <input type="text" id="workIdE" name="workId">
    <input type="text" id="serialNumberE" name="serialNumber">
    <input type="text" id="modelIdE" name="modelId">
    <input type="text" id="ruleIdE" name="ruleId">
    <input type="text" id="isHitE" name="isHit">
    <input type="text" id="satisfactionE" name="satisfaction">
</form>
<a id="basePath" th:href="@{/}"></a>
<div th:text="${workId}" id="workId1" class="hidden"></div>
<div th:text="${modelId}" id="modelId1" class="hidden"></div>
<div th:text="${modelName}" id="modelName" class="hidden"></div>
<script src="../../../assert/js/jquery.js" th:src="@{/assert/js/jquery.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/bootstrap.min.js" th:src="@{/assert/js/bootstrap.min.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/plugin/bootstrap-table/bootstrap-table.min.js"
        th:src="@{/assert/js/plugin/bootstrap-table/bootstrap-table.min.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/plugin/bootstrap-table/bootstrap-table-mobile.min.js"
        th:src="@{/assert/js/plugin/bootstrap-table/bootstrap-table-mobile.min.js}"></script>
<script src="../../../assert/js/plugin/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"
        th:src="@{/assert/js/plugin/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}"></script>
<script src="../../../assert/js/bootstrap-select.js" th:src="@{/assert/js/bootstrap-select.js}"></script>
<script src="../../../assert/js/plugin/toastr/toastr.min.js"
        th:src="@{/assert/js/plugin/toastr/toastr.min.js}"></script>
<script src="../../../assert/js/base.js"
        th:src="@{/assert/js/base.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/jquery-ui.min.js" th:src="@{/assert/js/jquery-ui.min.js}"></script>
<script src="../../../assert/js/plugin/layer/laydate/laydate.js"
        th:src="@{/assert/js/plugin/layer/laydate/laydate.js}"></script>
<script src="../../../assert/js/changeTime.js"
        th:src="@{/assert/js/changeTime.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/plugin/jsTree/jstree.min.js"
        th:src="@{/assert/js/plugin/jsTree/jstree.min.js}"></script>
<script src="../../../assert/js/plugin/chosen/chosen.jquery.js"
        th:src="@{/assert/js/plugin/chosen/chosen.jquery.js}"></script>
<script src="../../../assert/js/contabs.min.js"
        th:src="@{/assert/js/contabs.min.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script src="../../../assert/js/common.js"
        th:src="@{/assert/js/common.js(v_=${@commonController.getSysConfigByPK('CACHE_CODE')})}"></script>
<script>
    //项目名称
    var basePath = $("#basePath").attr("href");
    //    规则详情列表
    var TableInit1 = function () {
        var oTableInit1 = new Object();
        var url = basePath + "/rest/test-task/get-rule-detail-data";
        //初始化Table
        oTableInit1.Init = function () {
            $('#ruleTable').bootstrapTable({
                url: url,         //请求后台的URL（*）
                method: 'post',                      //请求方式（*）
                cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
//                sortable: true,                     //是否启用排序
//                sortName: "modelName", //排序方式
//                sortOrder: "asc",                   //排序方式
                pagination: true,                   //是否显示分页（*）
                pageNumber: 1,                       //初始化加载第一页，默认第一页
                pageSize: 10,                       //每页的记录行数（*）
                pageList: [10, 25, 50, 100],        //可供选择的每页的行数（*）
                queryParams: oTableInit1.queryParams,//传递参数（*）
                responseHandler: function (res) {
                    if (res.code != 0) {
                        toastrCog.error(res.msg, 3000);
                    }
                    return {
                        "total": res.count,//总页数
                        "rows": res.data   //数据
                    };
                },
                sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
                search: false,                       //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
                contentType: "application/x-www-form-urlencoded",
                strictSearch: true,
                showColumns: false,                  //是否显示所有的列
                showRefresh: false,                  //是否显示刷新按钮
                minimumCountColumns: 2,             //最少允许的列数
                clickToSelect: true,                //是否启用点击选中行
                uniqueId: "no",                     //每一行的唯一标识，一般为主键列
                showToggle: false,                    //是否显示详细视图和列表视图的切换按钮
                cardView: false,                    //是否显示详细视图
                detailView: false,
                cellStyle: {
                    css: {"background-color": "#fff"}
                },//是否显示父子表
                onDblClickRow: function (row, elem) {
                    var ruleId = row.ruleId;
                    $(".tabTitle span").eq(1).addClass("on").siblings().removeClass("on");
                    $(".tab1").show();
                    $(".tab0").hide();
                    $("#rule").val(ruleId).trigger("chosen:updated");
                    $("#myTable").bootstrapTable('refresh');
                },
                columns: [
//                    {
//                        checkbox: true, // 显示一个勾选框
//                        align: 'center' // 居中显示
//                    },
                    {
                        align: "center",
                        halign: "center",
                        title: '序号',//标题  可不加
                        width: 60,
                        formatter: function (value, row, index) {
                            var getOptions = $("#ruleTable").bootstrapTable('getOptions');
                            var pagenum = getOptions.pageNumber;
                            var pagesize = getOptions.pageSize;
                            var st = (pagenum - 1) * pagesize;
                            return (st + index + 1) + "";
                        }
                    },
                    {
                        align: "center",
                        halign: "center",
                        field: 'ruleTypeName',
                        title: '规则分类',
                        sortable: true
                    },
                    {
                        align: "center",
                        halign: "center",
                        field: 'ruleName',
                        title: '规则名称',
                        sortable: true
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'userFor',
                        title: '规则属性',
                        sortable: true,
//                        formatter: function (value, row, index) {
//                            var str = "";
//                            if (value == 0) {
//                                str = "系统"
//                            } else {
//                                str = "人工"
//                            }
//                            return str;
//
//                        },
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'fateful',
                        title: '致命性',
                        sortable: true,
                       formatter: function (value, row, index) {
                           var str="";
                           if(value==0){
                               str="否"
                           }else{
                               str="是"
                           }
                           if(row.signscore == 1) {
                               return ''
                           }else{
                               return str;
                           }
                       }
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'phoneCount',
                        title: '命中总量',
                        // sortable: true,
                        formatter: function (value, row, index) {
                            return '<div  class="J_menuItem" title="查看详情"  data-ruleId="' + row.ruleId + '">' + value + '</div>'
                        },
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'scoreCount',
                        title: '分值',
                        // sortable: true,
                        formatter: function (value, row, index) {
                            tools.scoreTotal += parseInt(value);
                            return value;
                        }
                    }
                ],
                onLoadSuccess: function (data) {  //加载成功时执行
                    resize.me(1)
                    if (!data.total || data.total == 0) {
                        $(".no-records-found").find("td").html('<img src="../../../assert/image/nodata.png" th:src="@{/assert/image/nodata.png}" style="width:165px;" alt="">');
                    }
                    $("#audioNum").html(tools.ruleTimesTotal);
                    $("#score").html(tools.scoreTotal);
                    tools.ruleTimesTotal = 0;
                    tools.scoreTotal = 0;
                },
                onLoadError: function () {  //加载失败时执行
                    $(".no-records-found").find("td").html('<img src="../../../assert/image/nodata.png" th:src="@{/assert/image/nodata.png}" style="width:165px;" alt="">');
                },
                formatLoadingMessage: function () {
                    return '<div class="loaded">' +
                        '<div class="loader">' +
                        '<div class="loader-inner line-scale-pulse-out">' +
                        '<div></div>' +
                        '<div></div>' +
                        '<div></div>' +
                        '<div></div>' +
                        '<div></div>' +
                        '</div>' +
                        '</div>' +
                        '</div>' +
                        '<div>请稍等，数据正在加载中...</div>';
                }
            });
        };
        //得到查询的参数
        oTableInit1.queryParams = function (params) {
            var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                pageNum: params.offset / params.limit,   //页面大小
                pageSize: params.limit,
                workId: $("#workId1").html(),
                modelId: $("#modelId1").html(),
                sortName: this.sortName,
                sortOrder: this.sortOrder,
            };
            return temp;
        };
        return oTableInit1;
    };
    //    语音列表
    var TableInit = function () {
        var oTableInit = new Object();
        var url = basePath + "/rest/test-task/get-phone-detail-data";
        var height = ($(window).height() -$(".tools_bar").height()-9-$(".search").height()-40);
        //初始化Table
        oTableInit.Init = function () {
            $('#myTable').bootstrapTable({
                url: url,         //请求后台的URL（*）
                method: 'post',                      //请求方式（*）
                cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
                height:height,
//                sortable: true,                     //是否启用排序
//                sortOrder: "asc",                   //排序方式
//                sortName: "customerloc", //排序方式
                pagination: true,                   //是否显示分页（*）
                queryParams: oTableInit.queryParams,//传递参数（*）
                responseHandler: function (res) {
                    if (res.code != 0) {
                        toastrCog.error(res.msg, 3000);
                    }
                    tools.tableData = res.data;
                    return {
                        "total": res.count,//总页数
                        "rows": res.data   //数据
                    };
                },
                sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
                pageNumber: 1,                       //初始化加载第一页，默认第一页
                pageSize: 10,                       //每页的记录行数（*）
                pageList: [10, 25, 50, 100],        //可供选择的每页的行数（*）
                search: false,                       //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
                contentType: "application/x-www-form-urlencoded",
                strictSearch: true,
                showColumns: false,                  //是否显示所有的列
                showRefresh: false,                  //是否显示刷新按钮
                minimumCountColumns: 2,             //最少允许的列数
                clickToSelect: true,                //是否启用点击选中行
                uniqueId: "no",                     //每一行的唯一标识，一般为主键列
                showToggle: false,                    //是否显示详细视图和列表视图的切换按钮
                cardView: false,                    //是否显示详细视图
                detailView: false,
                cellStyle: {
                    css: {"background-color": "#fff"}
                },//是否显示父子表
                onDblClickRow: function (row, elem) {
                    elem.find(".J_menuItem").click();
                },
                columns: [
                    {
                        align: "center",
                        halign: "center",
                        title: '序号',//标题  可不加
                        width: 60,
                        formatter: function (value, row, index) {
                            var getOptions = $("#myTable").bootstrapTable('getOptions');
                            var pagenum = getOptions.pageNumber;
                            var pagesize = getOptions.pageSize;
                            var st = (pagenum - 1) * pagesize;
                            return (st + index + 1) + "";
                        }
                    },
                    {
                        align: "center",
                        halign: "center",
                        field: 'province',
                        title: '省份',
                        sortable: true
                    },
                    {
                        align: "center",
                        halign: "center",
                        field: 'callDirection',
                        title: '呼叫类型',
                        sortable: true,
                        formatter: function (value, row, index) {
                            return bs.changeState(value, tools.callDirectionArr);
                        }
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'serialNumber',
                        title: '录音流水号',
                        sortable: true
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'seatGroup',
                        title: '坐席班组',
                        sortable: true
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'seatId',
                        title: '坐席工号',
                        sortable: true,
//                        formatter: function (value, row, index) {
//                            return tools.getNameInId(value);
//                        }
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'seatName',
                        title: '坐席姓名',
                        sortable: true,
//                        formatter: function (value, row, index) {
//                            return tools.getNameInId(value);
//                        }
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'customerNum',
                        title: '客户号码',
                        sortable: true
                    }, {
                        align: "right",
                        halign: "center",
                        field: 'holdDuration',
                        title: '通话时长(秒)',
                        sortable: true,
                        formatter: function (value, row, index) {
                            return '<span style="padding-right:20px;">' + value + '</span>';
                        }
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'callStartTime',
                        title: '通话开始时间',
                        sortable: true
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'callEndTime',
                        title: '通话结束时间',
                        sortable: true
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'onHook',
                        title: '挂机方',
                        sortable: true,
                        formatter: function (value, row, index) {
                            return bs.changeState(value, tools.onHookArr);
                        }
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'reCallFlag',
                        title: '是否重复来电',
                        sortable: true,
                        formatter: function (value, row, index) {
                            return bs.changeState(value, tools.reCallFlagArr);
                        }
                    }, {
                        align: "center",
                        halign: "center",
                        field: 'satisfaction',
                        title: '满意度',
                        sortable: true,
                        formatter: function (value, row, index) {
                            return bs.changeState(value, tools.agreeArr);
                        }
                    }, {
                        field: 'Button',
                        title: '操作',
                        formatter: function (value, row, index) {
                            var workId = $("#workId1").html();
                            var proStatus = row.proStatus;
                            var seatGroup = row.seatGroup;
                            var seatId = row.seatId;
                            var customerNumber = row.customerNum;
                            var callStartTime = row.callStartTime;
                            var callEndTime = row.callEndTime;
                            var serialNumber = row.serialNumber;
                            var params = {
                                workId: workId,
                                callStartTime: callStartTime,
                                callEndTime: callEndTime,
                                seatGroup: seatGroup,
                                seatId: seatId,
                                proStatus: proStatus,
                                customerNumber: customerNumber,
                                serialNumber: serialNumber,
                                modelId: $("#modelId1").html(),
                                modelName: $("#modelName").html(),
                                jumpType: "audio"
                            };
                            var href = basePath + "/rest/page/modelTestDetail?" + $.param(params);
                            return [
                                '<a href="' + href + '" class="fa fa-eye  handleBtn J_menuItem" id="lookDetail" title="查看详情" data-index="' + serialNumber + '模型测检" data-txt="' + serialNumber + '-详情"></a>'
                            ].join("");
                        },
                        events: {
                            'click #lookDetail': function (e, value, row, index) {

                            }
                        }
                    }
                ],
                onLoadSuccess: function (data) {  //加载成功时执行
                    bs.autoTableHeight($('#myTable'),$(window).height() -$(".tools_bar").height()-22-$(".tabTitle").height()-$(".search").height())
                    if (!data.total || data.total == 0) {
                        var src = basePath + "/assert/image/nodata.png";
                        $(".no-records-found").find("td").html('<img src="' + src + '" th:src="@{/assert/image/nodata.png}" style="width:165px;" alt="">');
                    }
                },
                onLoadError: function () {  //加载失败时执行
                    var src = basePath + "/assert/image/nodata.png";
                    $(".no-records-found").find("td").html('<img src="' + src + '" th:src="@{/assert/image/nodata.png}" style="width:165px;" alt="">');
                },
                formatLoadingMessage: function () {
                    return '<div class="loaded">' +
                        '<div class="loader">' +
                        '<div class="loader-inner line-scale-pulse-out">' +
                        '<div></div>' +
                        '<div></div>' +
                        '<div></div>' +
                        '<div></div>' +
                        '<div></div>' +
                        '</div>' +
                        '</div>' +
                        '</div>' +
                        '<div>请稍等，数据正在加载中...</div>';
                }
            });
        };
        //得到查询的参数
        oTableInit.queryParams = function (params) {
            var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                pageNum: params.offset,   //页面大小
                pageSize: params.limit,
                workId: $("#workId1").html(),
                modelId: $("#modelId1").html(),
                serialNumber: $.trim($("#serialNumber").val()),
                ruleId: $("#rule").val(),
                metType: "search",
                sortName: this.sortName,
                sortOrder: this.sortOrder,
                isHit:$("#isHit").val(),
                satisfaction: bs.filterSelectVal($("#agree"))
            };
            return temp;
        };
        return oTableInit;
    };
    var resize = {
        init: function () {
            resize.me(1);
            $(window).resize(function () {
                resize.me();
            })
        },
        me: function (one) {
            var winW = $(window).width();
            var winH = $(window).height();
            $(".ibox").width(winW - 20);
            $(".ibox").height(winH - 20);
            bs.autoTableHeight($('#ruleTable'),winH -$(".tools_bar").height()-22-$(".tabTitle").height())
            bs.autoTableHeight($('#myTable'),winH -$(".tools_bar").height()-22-$(".tabTitle").height()-$(".search").height())
        }
    };
    var tools = {
        ruleArr: [{
            "name": "全部",
            "value": ""
        }],//用来存储规则
        tableData: [],
        callDirectionArr: [],//用来存储呼叫类型状态
        onHookArr: [],//用来存储挂机方状态
        reCallFlagArr: [],//用来存储重复来电状态
        agreeArr: [],//用来存储满意度状态
        taskTypeArr: [],//用来存储满意度状态
        hitArr: [{
            "name": "是",
            "value": "1"
        }, {
            "name": "否",
            "value": "0"
        }],//用来存储命中状态
        init: function () {
            tools.getRule();
            tools.tabSearch();
            tools.search();
            tools.enterSearch();
            tools.reset();
            tools.refresh();
            tools.export();
            tools.tab();
            tools.jump();
            tools.getTaskType();
            tools.getHook();
            tools.getSatStatus();
            tools.getReCallFlag();
            tools.getCallDirection();
            bs.selectDownNoDisabled($("#isHit"), tools.hitArr, "");
            $("#isHit").val("1").trigger("chosen:updated");
        },
        getTaskType: function () {
            var dataArr = bs.getStatus("work_type");
            Object.assign(tools.taskTypeArr, dataArr);//es6复制数组的方法
        },
        getHook: function () {
            var dataArr = bs.getStatus("audio_onhook");
            Object.assign(tools.onHookArr, dataArr);//es6复制数组的方法
        },
        getSatStatus: function () {
            var dataArr = bs.getStatus("audio_satisfaction");
            Object.assign(tools.agreeArr, dataArr);//es6复制数组的方法
            bs.selectBootStrap($("#agree"), tools.agreeArr);
        },
        getReCallFlag: function () {
            var dataArr = bs.getStatus("recall_flag");
            Object.assign(tools.reCallFlagArr, dataArr);//es6复制数组的方法
        },
        getCallDirection: function () {
            var dataArr = bs.getStatus("call_direction");
            Object.assign(tools.callDirectionArr, dataArr);//es6复制数组的方法
        },
        getRule: function () {
            var url = basePath + "rest/pending-task-detail/get-rule-by-tree";
            $.ajax({
                type: "post",
                url: url,
                dataType: "json",
                data: {
                    workId: "",
                    modelId: $("#modelId1").html(),
                    ruleTypeId: ""
                },
                async: false,
                success: function (data) {
                    var arr = data.data;
                    for (var i = 0; i < arr.length; i++) {
                        var obj = {};
                        obj.name = arr[i].ruleName;
                        obj.value = arr[i].ruleId;
                        tools.ruleArr.push(obj);
                    }
                    bs.selectDownNoDisabled($("#rule"), tools.ruleArr, "");
                }
            });

        },
        tabSearch: function () {
            var search = $(".search");
            $("#btnSearch").on("click", function () {
                if (search.hasClass("on")) {
                    search.slideUp();
                    search.removeClass("on");
                    $("#btnSearch").html('<i class="fa fa-filter"></i> 查询').attr("title", "显示查询条");
                } else {
                    search.slideDown();
                    search.addClass("on");
                    $("#btnSearch").html('<i class="fa fa-filter"></i> 隐藏').attr("title", "隐藏查询条");
                }

            });
        },
        search: function () {
            $("#search").on("click", function () {
                tools.tableRefresh();
            })
        },
        enterSearch: function () {
            $("body").on("keyup", function (e) {
                var code = e.charCode || e.keyCode;
                if (code == 13) {
                    //此处编写用户敲回车后的代码
                    tools.tableRefresh();
                }
            })
        },
        tableRefresh: function () {
            $("#myTable").bootstrapTable('refreshOptions', {pageNumber: 1});
            $("#myTable").bootstrapTable('refresh');
            $("#ruleTable").bootstrapTable('refreshOptions', {pageNumber: 1});
            $("#ruleTable").bootstrapTable('refresh');
        },
        reset: function () {
            $("#reset").on("click", function () {
                bs.resetSearch($(".search"));
                $("#isHit").val("1").trigger("chosen:updated");
                $("#rule").val("").trigger("chosen:updated");
                tools.tableRefresh();
            })
        },
        resetSelect: function ($obj) {
            $obj.val("");
            $obj.trigger("chosen:updated");
        },
        refresh: function () {
            $("#refresh").on("click", function () {
                $("#myTable").bootstrapTable('refresh');
                $("#ruleTable").bootstrapTable('refresh');
            })
        },
        export: function () {
            $("#export").on("click", function () {
                if (tools.tableData.length == 0) {
                    toastrCog.error("没有可导出的数据哦！", 3000)
                    return;
                }
                var form = $("#exportForm");
                form.attr("action", basePath + "/rest/test-task/export-phone-detail-data");
                $("#workIdE").val($("#workId1").html().trim());
                $("#serialNumberE").val($("#serialNumber").val().trim());
                $("#modelIdE").val($("#modelId1").html().trim());
                $("#ruleIdE").val($("#rule").val().trim());
                $("#isHitE").val($("#isHit").val().trim());
                $("#satisfactionE").val(bs.filterSelectVal($("#agree")));
                form[0].submit();
            })
        },
        jump: function () {
//            $("#ruleTable").on("dblclick",".J_menuItem",function(){
//                var ruleId=$(this).attr("data-ruleId");
//                $(".tabTitle span").eq(1).addClass("on").siblings().removeClass("on");
//                $(".tab1").show();
//                $(".tab0").hide();
//                $("#rule").val(ruleId).trigger("chosen:updated");
//                $("#myTable").bootstrapTable('refresh');
//            })
        },
        tab: function () {
            $(".tabTitle span").on("click", function () {
                var index = $(this).index();
                $(this).addClass("on").siblings("span").removeClass("on");
                $(".tab").hide();
                $(".tab" + index).show();
                resize.me(1);
            })
        },
    };
    $(function () {
        resize.init();
        tools.init();
        var oTable = new TableInit();
        oTable.Init();
        var oTable1 = new TableInit1();
        oTable1.Init();
    })
</script>
</body>
</html>